<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/6/22
  Time: 22:34
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
%>



<ul>
    <c:forEach items="${requestScope.pageInfo.list}" var="a">
    <li>
        <h3><a href="<%=path%>/web/article/details?id=${a.id}" target="_blank">${a.title}</a></h3>
        <span>作者：${a.userinfo.nickname}</span>
        <span>收藏数：${a.collectCount}</span>
        <span>点赞数：${a.praiseCount}</span>
        <span>评论数：${a.commentCount}</span>
        <span>${a.garbageType.title}/${a.texture.title}</span>
        <p></p>

    </li>
    </c:forEach>
</ul>
<div class="pagination">
<c:forEach items="${requestScope.pageInfo.navigatepageNums}" var="i">
          <a href="javascript:void(0);" class="number" pn="pageNumber" id="${i}" data-id="${i}" style="border-radius: 40px;">${i}</a>
</c:forEach>
</div>

<script src="<%=path%>/static/js/jquery-3.3.1.min.js"></script>
<script>
    $(function () {

        //页码点击事件
        $("a[pn='pageNumber']").click(function () {
            pageNum = $(this).data("id");
            toAjax();
            $("a[id="+pageNum+"]").css("background-color","#87CEEB");
        })
    })

</script>
